using System;
using System.Globalization;
using System.Runtime.InteropServices;

namespace Landscape.Business.Interface
{
	public static class Utilities
	{
		public static DateTime GetDateTime(string pTarget)
		{
			char[] chrArray = new char[] { ' ' };
			string str = pTarget.Split(chrArray)[0];
			string str2 = string.Empty;
			int idx = 0;
			char[] chrArray1 = new char[] { '/' };
			string[] strArrays = str.Split(chrArray1);
			for (int i = 0; i < (int)strArrays.Length; i++)
			{
				string s = strArrays[i];
				str2 = (s.Trim().Length != 1 ? string.Concat(str2, s) : string.Concat(str2, "0", s));
				if (idx < 2)
				{
					str2 = string.Concat(str2, "/");
				}
				idx++;
			}
			return DateTime.ParseExact(str2, "MM/dd/yyyy", CultureInfo.InvariantCulture);
		}

		public static void ReleaseCOMObject(object pCOMObj)
		{
			Marshal.FinalReleaseComObject(pCOMObj);
			pCOMObj = null;
		}
	}
}